package tpf.designer.pattern.course10.homework.exercise2;

public class SelfConsumer implements Runnable {

    private final SelfQueue selfQueue;

    public SelfConsumer(SelfQueue selfQueue) {
        this.selfQueue = selfQueue;
    }

    @Override
    public void run() {
        while(true) {
            System.out.println("Consumed: "+ selfQueue.consume());
        }
    }
}
